import Vue from "vue";
import VueRouter from "vue-router";
// import Home from '../views/Home.vue'

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/Denlu", //重定向登录
  },
  {
    path: "/Denlu", //登录
    name: "Denlu",
    component: () => import("../views/Denlu/index.vue"),
  },
  {
    path: "/Index", //主页
    name: "Index",
    redirect: "/Home", //重定向登录
    component: () => import("../views/Index/index.vue"),
    children: [
      {
        path: "/Home", //首页
        name: "Home",
        redirect: "/Guanliyi", //重定向销售楼盘
        component: () => import("../views/Home/index.vue"),
        children: [
          {
            path: "/Guanliyi", //销售楼盘
            name: "Guanliyi",
            component: () => import("../views/Guanliyi/index.vue"),
          },
          {
            path: "/Guanlier", //房屋出租
            name: "Guanlier",
            component: () => import("../views/Guanlier/index.vue"),
          },
        ],
      },
      {
        path: "/List", //分类
        name: "List",
        component: () => import("../views/List/index.vue"),
      },
      {
        path: "/Kangyi", //kangyi
        name: "Kangyi",
        component: () => import("../views/Kangyi/index.vue"),
      },
      {
        path: "/Kanger", //Kanger
        name: "Kanger",
        component: () => import("../views/Kanger/index.vue"),
      },
      {
        path: "/Kangsan", //kangsna
        name: "Kangsan",
        component: () => import("../views/Kangsan/index.vue"),
      },
      {
        path: "/Zhibo", //直播
        name: "Zhibo",
        component: () => import("../views/Zhibo/index.vue"),
      },
      {
        path: "/Mold", //更多
        name: "Mold",
        component: () => import("../views/Mold/index.vue"),
      },
      {
        path: "/Many", ///我的quanxian
        name: "Many",
        component: () => import("../views/Many/index.vue"),
      },
      {
        path: "/quanxian", //权限管理
        name: "quanxian",
        component: () => import("../views/quanxian/index.vue"),
      },
      // {
      //   path: "/Guanliyi",
      //   name: "Denlu",
      //   component: () => import("../views/Denlu/index.vue"),
      // }, {
      //   path: "/Guanlier",
      //   name: "Denlu",
      //   component: () => import("../views/Denlu/index.vue"),
      // },
    ],
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
